<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    /**
     * 函数参数的初始值：
     * 1.具有默认值的形参一般靠后
     * 2.与解构赋值结合
     */
    let m1 = function (a, b, c = 10) {
        return a + b + c
    }
    let connect = function ({url = "localhost", username, password, time}) {
        console.log(url)
        console.log(username)
        console.log(password)
        console.log(time)
    }
    connect({
        url: "http://localhost:8080",
        username: "root",
        password: "000000",
        time: new Date().toTimeString()
    })
</script>
</body>
</html>